  <ListView
        android:id="@+id/list1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

    </ListView>
	
	private ListView  listView1;
	private ArrayAdapter<String> adapter;
    private List<String>   dataList = new ArrayList<>();
	listView1 =(ListView) findViewById(R.id.list1);
    adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,dataList);
    listView1.setAdapter(adapter);
	adapter.notifyDataSetChanged();
	listView1.setOnItemClickListener(new AdapterView.OnItemClickListener(){

            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

                String className = dataList.get(position);
             

            }
        });